import service from "@/utils/request";
import type { Response, PageResponse } from "@/types/common";
import type { AccessDeviceItem } from "@/types/access/device";

export const useAccessDevicePageApi = (params: object) => {
  return service<any, Response<PageResponse<AccessDeviceItem>>>({
    url: `/v1/access/device/page`,
    method: "GET",
    params,
  });
};

export const useAccessDeviceQueryApi = (params: object) => {
  return service<any, Response<AccessDeviceItem>>({
    url: `/v1/access/device/query`,
    method: "GET",
    params,
  });
};

export const useAccessDeviceCreateApi = (data: object) => {
  return service({
    url: `/v1/access/device/create`,
    method: "POST",
    data,
  });
};

export const useAccessDeviceUpdateApi = (data: object) => {
  return service({
    url: `/v1/access/device/update`,
    method: "POST",
    data,
  });
};

export const useAccessDeviceDeleteApi = (data: object) => {
  return service({
    url: `/v1/access/device/delete`,
    method: "DELETE",
    data,
  });
};
